package com.adam.blog.controller;


import com.adam.blog.service.LoginService;
import com.adam.blog.vo.Result;
import com.adam.blog.vo.params.LoginParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("login")
public class LoginController {
    //登录由登录业务自己执行，最好不要通过userService执行
    @Autowired
    private LoginService loginService;


    @PostMapping
    public Result login(@RequestBody LoginParams loginParams){


        return loginService.login(loginParams);
    }
}
